<?php


namespace App\Utils;


/**
 * Class Des3
 * @package des3
 */
class Des3
{
    /**
     * @var string
     */
    const KEY = 'ovZC64lIEhhG7hJva2w4xFBT';

    /**
     * @var string
     */
    const IV = 'TzdHrT7X';


    public static function encrypt($input)
    {
        return base64_encode(openssl_encrypt($input, "des-ede3-cbc", self::KEY, OPENSSL_RAW_DATA, self::IV));
    }

    public static function decrypt($encrypted)
    {
        return openssl_decrypt(base64_decode($encrypted), 'des-ede3-cbc', self::KEY, OPENSSL_RAW_DATA, self::IV);
    }

}
